<?php
/**
 * 
 * 
 * @version $Id: QQ.php 4 2012-08-30 02:58:54Z linsir123 $
 */
class controllerQQ extends WeiboController 
{
	/**
	 * 构造函数
	 */
	public function __construct()
	{
		parent::__construct();
		///
		$this->weibo = Weibo::qq();
	}
	
	/**
	 * 默认
	 */
	public function actionIndex()
	{
		if ($this->weibo->isLogin()) {
			$user = $this->weibo->getUser();
			///
			pr($user);
		} else {
			$oauthUrl = $this->weibo->getOauthUrl();
			echo '<a href="', $oauthUrl, '">点去授权</a>';
		}
	}
	
	/**
	 * 回调
	 */
	public function actionCallback()
	{
		if ($this->weibo->doCallback()) 
			lpUrl::_r('QQ');
		else 
			die('授权失败');
	}
}
